import { MockMethod } from 'vite-plugin-mock'

export default [
  {
    url: '/api/getUserInfo', // 注意，这里只能是string格式
    method: 'get',
    response: () => {
      return 'hello world and get mockData'
    },
  },
  {
    url: '/api/category', // 注意，这里只能是string格式
    method: 'get',
    response: () => {
      return {
        code: 0,
        data: [
          {
            id: 1,
            name: 'Java EE',
            root: true,
            parentId: null,
            children: [
              {
                id: 3,
                name: 'Servlet/JSP',
                root: false,
                parentId: 1,
                children: [],
              },
              {
                id: 4,
                name: '应用服务器',
                root: false,
                parentId: 1,
                children: [],
              },
              {
                id: 5,
                name: 'MVC框架',
                root: false,
                parentId: 1,
                children: [],
              },
            ],
          },
          {
            id: 2,
            name: '程序设计',
            root: true,
            parentId: null,
            children: [
              {
                id: 6,
                name: 'C/C++',
                root: false,
                parentId: 2,
                children: [
                  {
                    id: 9,
                    name: 'C11',
                    root: false,
                    parentId: 6,
                    children: [],
                  },
                ],
              },
              {
                id: 7,
                name: 'Java',
                root: false,
                parentId: 2,
                children: [],
              },
              {
                id: 8,
                name: 'C#',
                root: false,
                parentId: 2,
                children: [],
              },
            ],
          },
          {
            id: 10,
            name: 'Java EE',
            root: true,
            parentId: null,
            children: [
              {
                id: 11,
                name: 'Servlet/JSP',
                root: false,
                parentId: 1,
                children: [],
              },
              {
                id: 12,
                name: '应用服务器',
                root: false,
                parentId: 1,
                children: [],
              },
              {
                id: 13,
                name: 'MVC框架',
                root: false,
                parentId: 1,
                children: [],
              },
            ],
          },
          {
            id: 14,
            name: 'Java EE',
            root: true,
            parentId: null,
            children: [
              {
                id: 15,
                name: 'Servlet/JSP',
                root: false,
                parentId: 1,
                children: [],
              },
              {
                id: 16,
                name: '应用服务器',
                root: false,
                parentId: 1,
                children: [],
              },
              {
                id: 17,
                name: 'MVC框架',
                root: false,
                parentId: 1,
                children: [],
              },
            ],
          },
          {
            id: 18,
            name: 'Java EE',
            root: true,
            parentId: null,
            children: [
              {
                id: 19,
                name: 'Servlet/JSP',
                root: false,
                parentId: 1,
                children: [],
              },
              {
                id: 20,
                name: '应用服务器',
                root: false,
                parentId: 1,
                children: [],
              },
              {
                id: 21,
                name: 'MVC框架',
                root: false,
                parentId: 1,
                children: [],
              },
            ],
          },
        ],
      }
    },
  },
  {
    url: '/api/getHotBook', // 注意，这里只能是string格式
    method: 'get',
    response: () => {
      return {
        data: [
          {
            id: 1,
            title: ' VC++深入详解（第3版）',
            author: '孙鑫',
            price: 168.0,
            discount: 0.95,
            bookConcern: null,
            imgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            bigImgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            publishDate: null,
            brief: null,
            inventory: 1000,
          },
          {
            id: 2,
            title: 'Java编程思想',
            author: 'Bruce Eckel',
            price: 108.0,
            discount: 0.5,
            bookConcern: null,
            imgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            bigImgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            publishDate: null,
            brief: null,
            inventory: 500,
          },
          {
            id: 3,
            title: 'C Primer Plus 第6版',
            author: 'Stephen Prata',
            price: 89.0,
            discount: 0.5,
            bookConcern: null,
            imgUrl:
              'http://t14.baidu.com/it/u=444068582,3249212108&fm=224&app=112&f=JPEG?w=500&h=500',
            bigImgUrl:
              'http://t14.baidu.com/it/u=444068582,3249212108&fm=224&app=112&f=JPEG?w=500&h=500',
            publishDate: null,
            brief: null,
            inventory: 400,
          },
          {
            id: 4,
            title: 'Servlet/JSP深入详解',
            author: '孙鑫',
            price: 139.0,
            discount: 0.9,
            bookConcern: null,
            imgUrl:
              'http://t14.baidu.com/it/u=241860447,3318878220&fm=224&app=112&f=JPEG?w=500&h=500',
            bigImgUrl:
              'http://t14.baidu.com/it/u=241860447,3318878220&fm=224&app=112&f=JPEG?w=500&h=500',
            publishDate: null,
            brief: null,
            inventory: 1000,
          },
          {
            id: 5,
            title: 'Servlet/JSP深入详解',
            author: '孙鑫',
            price: 139.0,
            discount: 0.9,
            bookConcern: null,
            imgUrl:
              'http://t13.baidu.com/it/u=3674761671,2022206957&fm=224&app=112&f=JPEG?w=500&h=500',
            bigImgUrl:
              'http://t13.baidu.com/it/u=3674761671,2022206957&fm=224&app=112&f=JPEG?w=500&h=500',
            publishDate: null,
            brief: null,
            inventory: 1000,
          },
          {
            id: 6,
            title: 'Servlet/JSP深入详解',
            author: '孙鑫',
            price: 139.0,
            discount: 0.9,
            bookConcern: null,
            imgUrl:
              'https://img0.baidu.com/it/u=1715381235,3334173073&fm=253&fmt=auto&app=138&f=JPEG?w=757&h=500',
            bigImgUrl:
              'https://img0.baidu.com/it/u=1715381235,3334173073&fm=253&fmt=auto&app=138&f=JPEG?w=757&h=500',
            publishDate: null,
            brief: null,
            inventory: 1000,
          },
        ],
      }
    },
  },
  {
    url: '/api/book/new', // 注意，这里只能是string格式
    method: 'get',
    response: () => {
      return {
        data: [
          {
            id: 1,
            title: ' VC++深入详解（第3版）',
            author: '孙鑫',
            price: 168.0,
            discount: 0.95,
            bookConcern: null,
            imgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            bigImgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            publishDate: null,
            brief: null,
            inventory: 1000,
          },
          {
            id: 2,
            title: 'Java编程思想',
            author: 'Bruce Eckel',
            price: 108.0,
            discount: 0.5,
            bookConcern: null,
            imgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            bigImgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            publishDate: null,
            brief: null,
            inventory: 500,
          },
          {
            id: 3,
            title: 'C Primer Plus 第6版',
            author: 'Stephen Prata',
            price: 89.0,
            discount: 0.5,
            bookConcern: null,
            imgUrl:
              'http://t14.baidu.com/it/u=444068582,3249212108&fm=224&app=112&f=JPEG?w=500&h=500',
            bigImgUrl:
              'http://t14.baidu.com/it/u=444068582,3249212108&fm=224&app=112&f=JPEG?w=500&h=500',
            publishDate: null,
            brief: null,
            inventory: 400,
          },
          {
            id: 4,
            title: 'Servlet/JSP深入详解',
            author: '孙鑫',
            price: 139.0,
            discount: 0.9,
            bookConcern: null,
            imgUrl:
              'http://t14.baidu.com/it/u=241860447,3318878220&fm=224&app=112&f=JPEG?w=500&h=500',
            bigImgUrl:
              'http://t14.baidu.com/it/u=241860447,3318878220&fm=224&app=112&f=JPEG?w=500&h=500',
            publishDate: null,
            brief: null,
            inventory: 1000,
          },
          {
            id: 5,
            title: 'Servlet/JSP深入详解',
            author: '孙鑫',
            price: 139.0,
            discount: 0.9,
            bookConcern: null,
            imgUrl:
              'http://t13.baidu.com/it/u=3674761671,2022206957&fm=224&app=112&f=JPEG?w=500&h=500',
            bigImgUrl:
              'http://t13.baidu.com/it/u=3674761671,2022206957&fm=224&app=112&f=JPEG?w=500&h=500',
            publishDate: null,
            brief: null,
            inventory: 1000,
          },
          {
            id: 6,
            title: 'Servlet/JSP深入详解',
            author: '孙鑫',
            price: 139.0,
            discount: 0.9,
            bookConcern: null,
            imgUrl:
              'https://img0.baidu.com/it/u=1715381235,3334173073&fm=253&fmt=auto&app=138&f=JPEG?w=757&h=500',
            bigImgUrl:
              'https://img0.baidu.com/it/u=1715381235,3334173073&fm=253&fmt=auto&app=138&f=JPEG?w=757&h=500',
            publishDate: null,
            brief: null,
            inventory: 1000,
          },
        ],
      }
    },
  },
  {
    url: '/api/book/:id', // 注意，这里只能是string格式
    method: 'get',
    response: () => {
      return {
        data: [
          {
            id: 1,
            title: ' VC++深入详解（第666版）',
            author: '孙鑫',
            price: 168,
            discount: 0.95,
            bookConcern: '电子工业出版社',
            imgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            bigImgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            publishDate: '2019-06-01',
            brief: '....',
            inventory: 1000,
            detail:
              '哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈',
            newness: true,
            hot: true,
            specialOffer: false,
            slogan:
              '王者归来！畅销10万余册的《VC++深入详解》全新升级，基于VS2017新版本！ 内容更新！代码更新！实力更强！ ',
            category: {
              id: 6,
              name: 'C/C++',
              root: false,
              parentId: 2,
              children: null,
            },
          },
          {
            id: 2,
            title: ' VC++深入详解（第3版）',
            author: '孙鑫',
            price: 168,
            discount: 0.95,
            bookConcern: '电子工业出版社',
            imgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            bigImgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            publishDate: '2019-06-01',
            brief: '....',
            inventory: 1000,
            detail:
              '哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈',
            newness: true,
            hot: true,
            specialOffer: false,
            slogan:
              '王者归来！畅销10万余册的《VC++深入详解》全新升级，基于VS2017新版本！ 内容更新！代码更新！实力更强！ ',
            category: {
              id: 6,
              name: 'C/C++',
              root: false,
              parentId: 2,
              children: null,
            },
          },
          {
            id: 3,
            title: ' VC++深入详解（第3版）',
            author: '孙鑫',
            price: 168,
            discount: 0.95,
            bookConcern: '电子工业出版社',
            imgUrl:
              'http://t14.baidu.com/it/u=444068582,3249212108&fm=224&app=112&f=JPEG?w=500&h=500',
            bigImgUrl:
              'http://t14.baidu.com/it/u=444068582,3249212108&fm=224&app=112&f=JPEG?w=500&h=500',
            publishDate: '2019-06-01',
            brief: '....',
            inventory: 1000,
            detail:
              '哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈',
            newness: true,
            hot: true,
            specialOffer: false,
            slogan:
              '王者归来！畅销10万余册的《VC++深入详解》全新升级，基于VS2017新版本！ 内容更新！代码更新！实力更强！ ',
            category: {
              id: 6,
              name: 'C/C++',
              root: false,
              parentId: 2,
              children: null,
            },
          },
          {
            id: 4,
            title: ' VC++深入详解（第3版）',
            author: '孙鑫',
            price: 168,
            discount: 0.95,
            bookConcern: '电子工业出版社',
            imgUrl:
              'http://t14.baidu.com/it/u=241860447,3318878220&fm=224&app=112&f=JPEG?w=500&h=500',
            bigImgUrl:
              'http://t14.baidu.com/it/u=241860447,3318878220&fm=224&app=112&f=JPEG?w=500&h=500',
            publishDate: '2019-06-01',
            brief: '....',
            inventory: 1000,
            detail:
              '哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈',
            newness: true,
            hot: true,
            specialOffer: false,
            slogan:
              '王者归来！畅销10万余册的《VC++深入详解》全新升级，基于VS2017新版本！ 内容更新！代码更新！实力更强！ ',
            category: {
              id: 6,
              name: 'C/C++',
              root: false,
              parentId: 2,
              children: null,
            },
          },
          {
            id: 5,
            title: ' VC++深入详解（第3版）',
            author: '孙鑫',
            price: 168,
            discount: 0.95,
            bookConcern: '电子工业出版社',
            imgUrl:
              'http://t13.baidu.com/it/u=3674761671,2022206957&fm=224&app=112&f=JPEG?w=500&h=500',
            bigImgUrl:
              'http://t13.baidu.com/it/u=3674761671,2022206957&fm=224&app=112&f=JPEG?w=500&h=500',
            publishDate: '2019-06-01',
            brief: '....',
            inventory: 1000,
            detail:
              '哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈',
            newness: true,
            hot: true,
            specialOffer: false,
            slogan:
              '王者归来！畅销10万余册的《VC++深入详解》全新升级，基于VS2017新版本！ 内容更新！代码更新！实力更强！ ',
            category: {
              id: 6,
              name: 'C/C++',
              root: false,
              parentId: 2,
              children: null,
            },
          },
          {
            id: 6,
            title: ' VC++深入详解（第3版）',
            author: '孙鑫',
            price: 168,
            discount: 0.95,
            bookConcern: '电子工业出版社',
            imgUrl:
              'https://img0.baidu.com/it/u=1715381235,3334173073&fm=253&fmt=auto&app=138&f=JPEG?w=757&h=500',
            bigImgUrl:
              'https://img0.baidu.com/it/u=1715381235,3334173073&fm=253&fmt=auto&app=138&f=JPEG?w=757&h=500',
            publishDate: '2019-06-01',
            brief: '....',
            inventory: 1000,
            detail:
              '哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈',
            newness: true,
            hot: true,
            specialOffer: false,
            slogan:
              '王者归来！畅销10万余册的《VC++深入详解》全新升级，基于VS2017新版本！ 内容更新！代码更新！实力更强！ ',
            category: {
              id: 6,
              name: 'C/C++',
              root: false,
              parentId: 2,
              children: null,
            },
          },
        ],
      }
    },
  },
  {
    url: '/api/search', // 注意，这里只能是string格式
    method: 'get',
    response: () => {
      return {
        data: [
          {
            id: 1,
            title: ' VC++深入详解（第3版）',
            author: '孙鑫',
            price: 168.0,
            discount: 0.95,
            bookConcern: null,
            imgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            bigImgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            publishDate: null,
            brief: null,
            inventory: 1000,
          },
          {
            id: 2,
            title: 'Java编程思想',
            author: 'Bruce Eckel',
            price: 108.0,
            discount: 0.5,
            bookConcern: null,
            imgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            bigImgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            publishDate: null,
            brief: null,
            inventory: 500,
          },
          {
            id: 3,
            title: 'C Primer Plus 第6版',
            author: 'Stephen Prata',
            price: 89.0,
            discount: 0.5,
            bookConcern: null,
            imgUrl:
              'http://t14.baidu.com/it/u=444068582,3249212108&fm=224&app=112&f=JPEG?w=500&h=500',
            bigImgUrl:
              'http://t14.baidu.com/it/u=444068582,3249212108&fm=224&app=112&f=JPEG?w=500&h=500',
            publishDate: null,
            brief: null,
            inventory: 400,
          },
          {
            id: 4,
            title: 'Servlet/JSP深入详解',
            author: '孙鑫',
            price: 139.0,
            discount: 0.9,
            bookConcern: null,
            imgUrl:
              'http://t14.baidu.com/it/u=241860447,3318878220&fm=224&app=112&f=JPEG?w=500&h=500',
            bigImgUrl:
              'http://t14.baidu.com/it/u=241860447,3318878220&fm=224&app=112&f=JPEG?w=500&h=500',
            publishDate: null,
            brief: null,
            inventory: 1000,
          },
          {
            id: 5,
            title: 'Servlet/JSP深入详解',
            author: '孙鑫',
            price: 139.0,
            discount: 0.9,
            bookConcern: null,
            imgUrl:
              'http://t13.baidu.com/it/u=3674761671,2022206957&fm=224&app=112&f=JPEG?w=500&h=500',
            bigImgUrl:
              'http://t13.baidu.com/it/u=3674761671,2022206957&fm=224&app=112&f=JPEG?w=500&h=500',
            publishDate: null,
            brief: null,
            inventory: 1000,
          },
          {
            id: 6,
            title: 'Servlet/JSP深入详解',
            author: '孙鑫',
            price: 139.0,
            discount: 0.9,
            bookConcern: null,
            imgUrl:
              'https://img0.baidu.com/it/u=1715381235,3334173073&fm=253&fmt=auto&app=138&f=JPEG?w=757&h=500',
            bigImgUrl:
              'https://img0.baidu.com/it/u=1715381235,3334173073&fm=253&fmt=auto&app=138&f=JPEG?w=757&h=500',
            publishDate: null,
            brief: null,
            inventory: 1000,
          },
        ],
      }
    },
  },
  {
    url: '/api/book/category/:id', // 注意，这里只能是string格式
    method: 'get',
    response: () => {
      return {
        data: [
          {
            id: 1,
            title: ' VC++深入详解（第3版）',
            author: '孙鑫',
            price: 168.0,
            discount: 0.95,
            bookConcern: null,
            imgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            bigImgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            publishDate: null,
            brief: null,
            inventory: 1000,
          },
          {
            id: 2,
            title: 'Java编程思想',
            author: 'Bruce Eckel',
            price: 108.0,
            discount: 0.5,
            bookConcern: null,
            imgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            bigImgUrl:
              'https://img2.baidu.com/it/u=3568533297,4086559776&fm=253&fmt=auto?w=635&h=500',
            publishDate: null,
            brief: null,
            inventory: 500,
          },
          {
            id: 3,
            title: 'C Primer Plus 第6版',
            author: 'Stephen Prata',
            price: 89.0,
            discount: 0.5,
            bookConcern: null,
            imgUrl:
              'http://t14.baidu.com/it/u=444068582,3249212108&fm=224&app=112&f=JPEG?w=500&h=500',
            bigImgUrl:
              'http://t14.baidu.com/it/u=444068582,3249212108&fm=224&app=112&f=JPEG?w=500&h=500',
            publishDate: null,
            brief: null,
            inventory: 400,
          },
          {
            id: 4,
            title: 'Servlet/JSP深入详解',
            author: '孙鑫',
            price: 139.0,
            discount: 0.9,
            bookConcern: null,
            imgUrl:
              'http://t14.baidu.com/it/u=241860447,3318878220&fm=224&app=112&f=JPEG?w=500&h=500',
            bigImgUrl:
              'http://t14.baidu.com/it/u=241860447,3318878220&fm=224&app=112&f=JPEG?w=500&h=500',
            publishDate: null,
            brief: null,
            inventory: 1000,
          },
          {
            id: 5,
            title: 'Servlet/JSP深入详解',
            author: '孙鑫',
            price: 139.0,
            discount: 0.9,
            bookConcern: null,
            imgUrl:
              'http://t13.baidu.com/it/u=3674761671,2022206957&fm=224&app=112&f=JPEG?w=500&h=500',
            bigImgUrl:
              'http://t13.baidu.com/it/u=3674761671,2022206957&fm=224&app=112&f=JPEG?w=500&h=500',
            publishDate: null,
            brief: null,
            inventory: 1000,
          },
          {
            id: 6,
            title: 'Servlet/JSP深入详解',
            author: '孙鑫',
            price: 139.0,
            discount: 0.9,
            bookConcern: null,
            imgUrl:
              'https://img0.baidu.com/it/u=1715381235,3334173073&fm=253&fmt=auto&app=138&f=JPEG?w=757&h=500',
            bigImgUrl:
              'https://img0.baidu.com/it/u=1715381235,3334173073&fm=253&fmt=auto&app=138&f=JPEG?w=757&h=500',
            publishDate: null,
            brief: null,
            inventory: 1000,
          },
        ],
      }
    },
  },
  {
    url: '/api/book/:id/comment', // 注意，这里只能是string格式
    method: 'get',
    response: () => {
      return {
        data: [
          {
            id: 1,
            content: '哈哈哈哈哈哈哈哈哈哈哈哈哈哈',
            commentDate: '2022-11-12T00:12:30',
            username: 'zzd',
            book: null,
          },
          {
            id: 2,
            content: '哈哈哈哈哈哈哈哈哈哈哈哈哈哈',
            commentDate: '2022-11-12T00:12:30',
            username: 'zzd',
            book: null,
          },
          {
            id: 3,
            content: '哈哈哈哈哈哈哈哈哈哈哈哈哈哈',
            commentDate: '2022-11-12T00:12:30',
            username: 'zzd',
            book: null,
          },
          {
            id: 4,
            content: '哈哈哈哈哈哈哈哈哈哈哈哈哈哈',
            commentDate: '2022-11-12T00:12:30',
            username: 'zzd',
            book: null,
          },
          {
            id: 5,
            content: '哈哈哈哈哈哈哈哈哈哈哈哈哈哈',
            commentDate: '2022-11-12T00:12:30',
            username: 'zzd',
            book: null,
          },
          {
            id: 6,
            content: '哈哈哈哈哈哈哈哈哈哈哈哈哈哈',
            commentDate: '2022-11-12T00:12:30',
            username: 'zzd',
            book: null,
          },
        ],
      }
    },
  },
  {
    url: '/api/user/register', // 注意，这里只能是string格式
    method: 'post',
    response: () => {
      return {
        data: {
          id: 1,
          username: 'zzd',
        },
      }
    },
  },
] as MockMethod[] // 这里其实就是定义数据格式的，不了解的同学可以参考typescript的官方文档
